package com.xf.lastmall.moudle.enums;

import lombok.Getter;

/**
 * Created by wangzhaoqian5 on 2018/8/3.
 */
@Getter
public enum RefundOrderAuditStatus {
    AUDIT_BEGIN("1", "待初审"),
    AUDIT_REJECT("2", "初审驳回"),
    REVIEW_BEGIN("3", "待复审"),
    REVIEW_REJECT_AUDIT("4", "复审驳回待初审"),
    CASHIER_BEGIN("5", "待付款审核"),
    CASHIER_REJECT_REVIEW("6", "付款审核驳回"),
    REFUND_PROCESSING("7", "退款处理中"),
    REFUND_COMPLETE("8", "退款完成");

    private final String value;

    private final String text;

    RefundOrderAuditStatus(String value, String text) {
        this.value = value;
        this.text = text;
    }

    public static RefundOrderAuditStatus fromValue(String value) {
        for (RefundOrderAuditStatus action : RefundOrderAuditStatus.values()) {
            if (action.getValue().equals(value)) {
                return action;
            }
        }
        return null;
    }

    public static RefundOrderAuditStatus fromText(String text) {
        for (RefundOrderAuditStatus action : RefundOrderAuditStatus.values()) {
            if (action.getText().equals(text)) {
                return action;
            }
        }
        return null;
    }
}
